<html>
<head>
<#assign basePath=request.contextPath>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <link href="${basePath}/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/font-awesome.min.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/form.lzy.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/good.lzy.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css"
          rel="stylesheet">
    <style>
        #page-wrapper h1 {
            display: block;
            margin-bottom: 20px;
            border-bottom: 1px solid #999;
            font-size: 16px;
            padding-left: 2px;
            font-weight: bold;
            line-height: 35px;
        }

        select.year, select.mouth {
            width: 100px;
        }

        #btn {
            display: inline-block;
            background-color: #ffbe34;
            line-height: 35px;
            padding: 0 15px;
            font-size: 14px;
            color: #fff;
            border-radius: 4px;
            cursor: pointer;
        }

        #depart-box {
            display: block;
            padding: 20px;
        }

        #depart-box label {
            display: inline-block;
            margin: 20px 20px 0;
        }

        #depart-box .bot {
            display: block;
            padding-top: 50px;
            text-align: center;
        }

        #fileValue {
            opacity: 0;
            width: 0px;
            height: 0px;
            font-size: 0px;
        }

        #file {
            display: inline-block;
        }

        .check-box, .identity-box {
            display: none;
        }

        .text {
            display: block;
        }
        .span-text{margin-left: 30px;}
        #fileValue{ width: 0; height: 0; opacity: 0; font-size: 0;}
    </style>
</head>
<body>

<div class="panel panel-lzy">
    <div class="panel-body">
        <h5 class="tips-lzy">操作提示</h5>
        <ul class="tips-list-lzy">
            <li><span>◆&nbsp;<span>标识“<font color="red">*</font>”的选项为必填项，其余为选填项。</span></span></li>
        </ul>
    </div>
</div>

<div id="page-wrapper">
    <div class="panel panel-f5">
        <div class="panel-body row">
            <h1>● 基础信息</h1>
            <form id="Form" class="form-horizontal" method="post">
                <input type="hidden" id="_ctx" value="${basePath}"/>
                <input type="hidden" id="id" name="id" <#if dto??>value="${dto.id!}"</#if>/>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4  detail-span"><font
                            color="red">*</font>&nbsp;产品名称：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="text" class="form-control" size="50" name="name" maxlength="50"
                               placeholder="最多输入50字"
                               <#if dto??>value="${dto.name!}"</#if>>
                    <#--<span class="text-warning">0/50</span>-->
                    </div>
                </div>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4  detail-span">&nbsp;<font color="red">*</font>&nbsp;产品售价：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="text" class="form-control" size="30" name="price" maxlength="10" min="0.01"
                               <#if dto??>value="${(dto.price)?c}"</#if>>
                    </div>
                </div>

                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4  detail-span">&nbsp;<font color="red">*</font>&nbsp;产品封面：</span>
                    <div class="col-sm-9 col-xs-8">
                    <#if (dto.cover)??>
                        <input class="obj-input" id="cover" name="cover" value="${dto.cover!}" type="text">
                        <img class="obj-img" src="${dto.cover!}" width="100" height="100">
                        <span class="input-file-edit">
                            <input type="file" data-action="goods" data-image="banner"
                                   onchange="uploadImg(this)">
                        </span>
                    <#else>
                        <input class="obj-input" id="cover" name="cover" value="" type="text">
                        <img class="obj-img" src="" style="display:none" width="100" height="100">
                        <span class="input-file">
                            <input type="file" data-action="goods" data-image="banner"
                                   onchange="uploadImg(this)">
                        </span>
                    </#if>
                        <span class="text-warning">封面图大小不能超过3MB，为了图片清晰美观，建议上传宽度730像素的图片。</span>
                    </div>
                </div>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4 detail-span">产品视频：</span>
                    <div class="col-sm-9 col-xs-8">
                    <#if (dto.video)??>
                        <input type="file" data-action="icon" data-image="video" onchange="uploadFile(this,'.mp4',50)">
                        <input type="hidden" id="fileValue" name="video" value="${dto.video!}">
                        <video id="fileName" src="${dto.video!}" controls="controls" style="max-height: 200px;">
                            您的浏览器不支持 video 标签。
                        </video>
                    <#--<input class="obj-input" id="video" name="video" value="${dto.video!}" type="text">-->
                    <#--<img class="obj-img" src="${dto.video!}" width="100" height="100">-->
                    <#--<span class="input-file-edit">-->
                    <#--<input type="file" data-action="goods" data-image="video" onchange="uploadFile(this)">-->
                    <#--</span>-->
                    <#else>
                        <input type="file" data-action="icon" data-image="video" onchange="uploadFile(this,'.mp4',50)">
                        <input type="hidden" id="fileValue" name="video" value="">
                        <video id="fileName" src="" controls="controls" style="display: none; max-height: 200px;">
                            您的浏览器不支持 video 标签。
                        </video>
                    </#if>
                        <span class="text-warning text">请上传不超过50MB大小的mp4格式视频文件</span>
                    </div>
                </div>
                <h1>● 详细描述</h1>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4">产品介绍：</span>
                    <div class="col-sm-9 col-xs-8 add-box image-text">
                    <#if (dto.detailImages)??>
                        <#list dto.detailImages as imageText>
                            <#if imageText.type == 1>
                                <div class="text-box">
                                    <textarea data-id="0" name='detailImages[0].path' maxlength="1900" rows="3"
                                              cols="50" class="form-control"
                                              placeholder="最多输入2000字">${imageText.path!}</textarea>
                                    <input class="sort" name='detailImages[0].sort' value="0" type="hidden"/>
                                    <input name='detailImages[0].type' value="1" type="hidden"/>
                                </div>
                            <#elseif imageText.type == 2>
                                <div class="text-box">
                                    <div class="upload-box">
                                        <input class="obj-input" name="detailImages[1].path" value="${imageText.path!}"
                                               type="hidden">
                                        <img class="obj-img" src="${imageText.path!}">
                                        <span class="input-file-edit">
                                            <input data-id="1" type="file" data-action="goods"
                                                   data-image="detailImages[1].path" class="no text field"
                                                   onchange="uploadImg(this)">
                                        </span>
                                        <input class="sort" name='detailImages[1].sort' value="1" type="hidden"/>
                                        <input name='detailImages[1].type' value="2" type="hidden"/>
                                    </div>
                                </div>
                            </#if>
                        </#list>
                    <#else>
                        <div class="text-box">
                            <textarea data-id="0" name='detailImages[0].path' maxlength="1900" rows="3" cols="50"
                                      class="form-control" placeholder="最多输入2000字"></textarea>
                            <input class="sort" name='detailImages[0].sort' value="0" type="hidden"/>
                            <input name='detailImages[0].type' value="1" type="hidden"/>
                        </div>
                        <div class="text-box">
                            <div class="upload-box">
                                <input class="obj-input" name="detailImages[1].path" value="" type="text">
                                <img class="obj-img" src="" style="display:none">
                                <span class="input-file">
								    <input data-id="1" type="file" data-action="goods" data-image="detailImages[1].path"
                                           class="no text field" onchange="uploadImg(this)">
							    </span>
                                <input class="sort" name='detailImages[1].sort' value="1" type="hidden"/>
                                <input name='detailImages[1].type' value="2" type="hidden"/>
                            </div>
                        </div>
                    </#if>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4  detail-span"><font
                            color="red">*</font>&nbsp;文档名称：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="text" class="form-control" size="50" name="officeName" maxlength="50"
                               placeholder="最多输入50字"
                               <#if dto??>value="${dto.officeName!}"</#if>>
                    <#--<span class="text-warning">0/50</span>-->
                    </div>
                </div>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4 detail-span"><font
                            color="red">*</font>&nbsp;上传文档：</span>
                    <div class="col-sm-9 col-xs-8">
                    <#if (dto.office)??>
                        <input type="text" id="fileText" class="form-control" size="50" value="${dto.office!}" readonly />
                        <input type="file" data-action="office" data-image="word" onchange="uploadFile(this,'.docx',10)" id="file">
                        <input type="text" id="fileValue" name="office" value="${dto.office!}">
                    <#else>
                        <input type="text" id="fileText" class="form-control" size="50" value="" readonly style="display: none" />
                        <input type="file" data-action="office" data-image="word" onchange="uploadFile(this,'.docx',10)" id="file">
                        <input type="text" id="fileValue" name="office" value="" class="file">
                    </#if>
                        <span class="text-warning text">请上传不超过10MB*.docx格式的标准文档</span>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
					<span class="control-label col-sm-2 col-xs-4 detail-span"><span
                            class="text-red"></span> 备注：</span>
                    <div class="col-sm-10 col-xs-8 add-box">
                        <div class="text-box">
                        <#--<span class="text-warning">&nbsp;0/1000</span>-->
                            <textarea data-id="0" name='remark' id="remark"
                                      class="form-control" maxlength="900"
                                      placeholder="最多输入1000字"><#if dto??>${dto.remark!}</#if></textarea>
                        </div>
                    </div>
                </div>

                <h1>● 产品是否开通身份</h1>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4 detail-span"><input type="checkbox" data-name="identityId" class="check-input"
                                                                                     id="identity-input"
                                                                                     <#if dto.identityId?? && dto.identityId != 0 >checked</#if>>&nbsp;身份：</span>
                    <div class="col-sm-9 col-xs-8 check-box">
                        <select class="form-control" name="identityId" id="identityId">
                            <option value="0">请选择</option>
                        <#if (dto.identityId)??>
                            <!--edit-->
                            <#list identityList as item>
                                <option value="${item.id!}"
                                        <#if dto.identityId == item.id>selected="selected"</#if>>${item.name!}</option>
                            </#list>
                        <#else>
                            <!--add-->
                            <#list identityList as item>
                                <option value="${item.id!}">${item.name!}</option>
                            </#list>
                        </#if>
                        </select>
                        <span class="text-warning">请选择该业务包含的用户身份</span>
                    </div>
                </div>
                <h1>● 产品内容</h1>
                <div class="pro-box">
                <#if proList??>
                    <#list proList as pro>
                        <div class="form-group">
                        <span class="control-label col-sm-2 col-xs-4">
                            <input type="checkbox" class="check-input" data-name="projectList[${pro_index!}].containNum" <#if (pro.containNum)??>checked</#if>
                                   name="projectList[${pro_index!}].projectId"
                                   value="${pro.projectId!}">&nbsp;${pro.name!}：</span>
                            <div class="col-sm-9 col-xs-8 check-box">
                                <input type="text" class="form-control" size="5" maxlength="10"
                                       name="projectList[${pro_index!}].containNum"
                                       value="${(pro.containNum)?c}">&nbsp;${pro.unit!}&nbsp;
                                <select class="form-control" name="projectList[${pro_index!}].type">
                                    <option value="0" <#if (pro.type)?? && pro.type == 0>selected</#if>>固定项</option>
                                    <option value="1" <#if (pro.type)?? && pro.type == 1>selected</#if>>单选项</option>
                                </select>
                                <span class="text-warning">请输入该产品单笔包含${pro.name!}的数量</span>
                                <#if pro.projectId == 3 || pro.projectId == 4>
                                    <span class="span-text">券有效期
                                    <input type="text" class="form-control" size="5" maxlength="6" min="1"
                                           name="projectList[${pro_index!}].validTime" value="${(pro.validTime)?c}">&nbsp;天</span>
                                </#if>
                            </div>
                        </div>
                    </#list>
                <#else>
                    <#list projectList as pro>
                        <div class="form-group">
                        <span class="control-label col-sm-2 col-xs-4">
                                <input type="checkbox" class="check-input"
                                       name="projectList[${pro_index!}].projectId"
                                       value="${pro.id!}">&nbsp;${pro.name!}：</span>
                            <div class="col-sm-9 col-xs-8 check-box">
                                <input type="text" class="form-control" size="5" maxlength="10" min="1"
                                       name="projectList[${pro_index!}].containNum" value="">&nbsp;${pro.unit!}&nbsp;
                                <select class="form-control" name="projectList[${pro_index!}].type">
                                    <option value="0">固定项</option>
                                    <option value="1">单选项</option>
                                </select>
                                <span class="text-warning">请输入该产品单笔包含${pro.name!}的数量</span>
                                <#if pro.id == 3 || pro.id == 4>
                                    <span class="span-text">券有效期
                                    <input type="text" class="form-control" size="5" maxlength="6" min="1"
                                           name="projectList[${pro_index!}].validTime" value="">&nbsp;天</span>
                                </#if>
                            </div>
                        </div>
                    </#list>
                </#if>
                </div>
                <h1>● 其他设置</h1>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4 detail-span">选择分类：</span>
                    <div class="col-sm-9 col-xs-8">
                    <#if (dto.classifyId)??>
                        <input id="departName" type="text" class="form-control" size="30" name="departName"
                               value="${dto.classifyName!}"
                               readonly>
                        <input id="departId" type="hidden" name="classifyId" value="${dto.classifyId!}">
                    <#else>
                        <input id="departName" type="text" class="form-control" size="30" name="departName" value=""
                               readonly>
                        <input id="departId" type="hidden" name="classifyId" value="">
                    </#if>
                        <span id="btn">选择分类</span>
                        <span class="text-warning">请设置该产品对应的分类</span>
                    </div>
                </div>
                <div class="form-group">
                    <span class="control-label col-sm-2 col-xs-4  detail-span">&nbsp;分类拨比设置：</span>
                    <div class="col-sm-9 col-xs-8">
                    <#if (dto.profit)??>
                        <input type="text" class="form-control" size="30" name="profit" value="${dto.profit}" min="0.01"
                               maxlength="10" max="100"/><span>%</span>
                    <#else>
                        <input type="text" class="form-control" size="30" name="profit" value="" min="0.01"
                               maxlength="10" max="100"/><span>%</span>
                    </#if>
                        请输入数字
                    </div>
                </div>
                <hr>
                <div class="form-group">
                    <span class="control-label col-sm-4 col-xs-4"></span>
                    <div class="col-sm-8 col-xs-8">
                    <#if dto??>
                        <button type="button" class="btn btn-success" onclick="submitFormEdit();"><i
                                class="fa fa-check"></i>提交
                        </button>
                    <#else>
                        <button type="button" class="btn btn-success" onclick="submitForm();"><i
                                class="fa fa-check"></i> 提交
                        </button>
                    </#if>
                        <button type="button" class="btn btn-info" onclick="goBack()"><i class="fa fa-close"></i>返回
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<div id="depart-box" style="display: none;">
<#if classifyList?? && classifyDto??>
    <#list classifyList as cla>
        <label><input type="radio" name="classifyName" value="${cla.id!}" <#if cla.id == classifyDto.id>checked</#if>>
            <span>${cla.name!}</span></label>
    </#list>
<#else>
    <#list classifyList as cla>
        <label><input type="radio" name="classifyName" value="${cla.id!}"> <span>${cla.name!}</span></label>
    </#list>
</#if>
    <div class="bot">
        <button type="button" class="btn btn-success">确定</button>
    </div>
</div>

<script src="${basePath}/bootstrap/js/jquery.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/plugin/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript"
        src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/language/zh_CN.js"></script>
<script type="text/javascript">
    $(window).bootstrapValidator || document.write('<script src="${basePath}/bootstrap/js/bootstrapValidator.min.js"><\/script>' +
            '<script src="${basePath}/bootstrap/js/bootstrapValidator-zh_CN.js"><\/script>');
</script>
<script src="${basePath}/bootstrap/js/common.js" type="text/javascript"></script>
<script type="text/javascript"
        src="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
        src="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${basePath}/bootstrap/js/campsite.js" type="text/javascript"></script>
<script>

    function goBack() {
        window.location.href = "${basePath}/admin/product/info"
    }
    $(function () {
        //产品内容
//        var box = $(".pro-box");
//        var len = box.find(".item0").length;
//        for(var i=0;i<len;i++){
//            box.find(".pro"+i).each(function(){
//
//                if($(this).hasClass("remove")){
//                    $(this).siblings(".pro"+i).hide();
//                }
//                else{
//                    $(this).siblings(".pro"+i).each(function(){
//                        if($(this).hasClass("remove")){
//                            return false
//                        }
//                        else{
//                            box.find(".pro"+i).eq(0).siblings(".pro"+i).hide();
//                        }
//                    })
//                }
//
//            })
//        }

        $(".check-input").each(function () {
            $(this).change(function () {
                var _this = $(this).parent().siblings(".check-box");
                var dataName = $(this).attr('data-name');
                if ($(this).is(":checked")) {
                    $('#Form').data("bootstrapValidator").validateField(dataName);
                    _this.show();
                } else {
                    $('#Form').data("bootstrapValidator").validateField(dataName).updateStatus(dataName, "NOT_VALIDATED", null);
                    _this.hide();
                }
            })
        })

        $(".check-input").each(function () {
            var _this = $(this).parent().siblings(".check-box");
            if ($(this).is(":checked")) {
                _this.show();
            } else {
                _this.hide();
            }
        })


//        $('#start_visit_time').datetimepicker({
//            minView: "month", //选择日期后，不会再跳转去选择时分秒
//            format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式
//            language: 'zh-CN', //汉化
//            autoclose:true //选择日期后自动关闭
//        });
//        $('#end_visit_time').datetimepicker({
//            minView: "month", //选择日期后，不会再跳转去选择时分秒
//            format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式
//            language: 'zh-CN', //汉化
//            autoclose:true //选择日期后自动关闭
//        });

        $("#btn").click(function () {
            //请求数据成功后 => 弹窗
            //$.ajax();
            var box = $("#depart-box");
            var nameArr = [], idArr = [];
            layer.open({
                type: 1,
                area: ['500px', '400px'],
                title: '产品分类选择',
                content: box,
                success: function () {
                    box.find("button").off("click").click(function () {
                        box.find("label").each(function () {
                            var _this = $(this).find("input");
                            if (_this.is(":checked")) {
                                idArr.push(_this.val());
                                nameArr.push(_this.siblings("span").text());
                            }
                        });
                        //赋值
                        $("#departName").val(nameArr).show().change();
                        $("#departId").val(idArr);
                        layer.closeAll();
                    })
                },
                end: function () {
                    layer.closeAll();
                }
            });

        })


    });

    //新增
    function submitForm() {
        var bsVal = $("#Form").data('bootstrapValidator');
        bsVal.validate();
        if (bsVal.isValid()) {
            $.ajax({
                type: 'POST',
                dataType: 'json',
                url: '${basePath}/admin/product/info/save',
                data: $("#Form").serialize(),
                success: function (data) {
                    if (data.code == '0') {
                        layer.alert('操作成功', {
                            icon: 1
                        }, function () {
                            window.location.href = '${basePath}/admin/product/info';
                        })
                    } else {
                        layer.alert(data.desc, {
                            icon: 5
                        });
                    }
                },
                error: function () {
                    layer.alert('系统错误', {
                        icon: 5
                    });
                }
            });

        }
        else {
            var smallTop = $("small:visible").eq(0).offset().top - 50;
            $("html,body").animate({scrollTop: smallTop}, 300);
        }
    }

    //编辑
    function submitFormEdit() {

        if (!$("#identity-input").is(":checked")) {
            $("#identityId").val("0")
        }

        var bsVal = $("#Form").data('bootstrapValidator');
        bsVal.validate();
        if (bsVal.isValid()) {
            $.ajax({
                type: 'POST',
                dataType: 'json',
                url: '${basePath}/admin/product/info/update',
                data: $("#Form").serialize(),
                success: function (data) {
                    if (data.code == '0') {
                        layer.alert('操作成功', {
                            icon: 1
                        }, function () {
                            window.location.href = '${basePath}/admin/product/info';
                        })
                    } else {
                        layer.alert(data.desc, {
                            icon: 5
                        });
                    }
                },
                error: function () {
                    layer.alert('系统错误', {
                        icon: 5
                    });
                }
            });

        }
        else {
            var smallTop = $("small:visible").eq(0).offset().top - 50;
            $("html,body").animate({scrollTop: smallTop}, 300);
        }
    }

    //    $('#identity-input').on('click', function () {
    //        if ($(this).prop('checked')) {
    //            //$('#roomTicketMoney').show();
    //            $('#myForm').data("bootstrapValidator").validateField('identityId');
    //        } else {
    //            $('#myForm').data("bootstrapValidator").validateField('identityId').updateStatus("identityId", "NOT_VALIDATED", null);
    //            //$('#roomTicketMoney').hide();
    //
    //        }
    //    });

    //表单验证
    $('#Form').bootstrapValidator({
        fields: {
            name: {
                validators: {
                    notEmpty: {
                        message: '请输入产品名称'
                    }
                }
            },
            cover: {
                trigger: "change",
                validators: {
                    notEmpty: {
                        message: '请上传产品封面'
                    }
                }
            },
            office: {
                trigger: "change",
                validators: {
                    notEmpty: {
                        message: '请上传文档'
                    }
                }
            },
            price: {
                validators: {
                    notEmpty: {
                        message: '请输入产品售价'
                    },
                    regexp: {
                        regexp: regPrice,
                        message: '请输入最多两位小数的数字'
                    }
                }
            },
            banner: {
                trigger: "change",
                validators: {
                    notEmpty: {
                        message: '请上传套餐封面'
                    }
                }
            },
            officeName: {
                validators: {
                    notEmpty: {
                        message: '请输入文档名称'
                    }
                }
            },
//            profit: {
//                validators: {
//                    notEmpty: {
//                        message: '请输入分类拨比设置'
//                    },
//                    regexp: {
//                        regexp: regPrice,
//                        message: '请输入最多两位小数的数字'
//                    }
//                }
//            },

            identityId: {
                validators: {
                    callback: {
                        message: '请选择用户身份',
                        callback:function (value) {
                            if($('#identity-input').prop('checked')){
                                if(value==0){
                                    return false;
                                }else{
                                    return true;
                                }
                            }else{
                                return true
                            }

                        }
                    }
                }
            },
            'projectList[0].containNum': {
                validators: {
                    notEmpty: {
                        message: '请输入数量'
                    },
                    regexp: {
                        regexp: regInt,
                        message: '请输入整数'
                    }
                }
            },
            'projectList[1].containNum': {
                validators: {
                    notEmpty: {
                        message: '请输入数量'
                    },
                    regexp: {
                        regexp: regInt,
                        message: '请输入整数'
                    }
                }
            },
            'projectList[2].containNum': {
                validators: {
                    notEmpty: {
                        message: '请输入数量'
                    },
                    regexp: {
                        regexp: regInt,
                        message: '请输入整数'
                    }
                }
            },
            'projectList[3].containNum': {
                validators: {
                    notEmpty: {
                        message: '请输入数量'
                    },
                    regexp: {
                        regexp: regInt,
                        message: '请输入整数'
                    }
                }
            },
            'projectList[4].containNum': {
                validators: {
                    notEmpty: {
                        message: '请输入数量'
                    },
                    regexp: {
                        regexp: regInt,
                        message: '请输入整数'
                    }
                }
            }
        }
    });
</script>
</body>
</html>
